!!!###!!!title=194-How to customize the text content of the legend——VisActor/VChart FAQ documents!!!###!!!

How to customize the text content of the legend?

Problem Description

As shown below, how to replace the "x" in the picture with the number of product clicks?

solution

This corresponds to the legend part of the chart. Different chart libraries have different solutions. The configuration on VChart is introduced below. On VChart, the legend corresponds to the legends attribute. "x" corresponds to the label text on the legend item, which corresponds to The property is legends.item.label, and then we can format the displayed text through the formatMethod property provided by this property.

Code Example